package com.itheima.demo.controller;


import com.itheima.demo.pojo.User;
import com.itheima.demo.utils.JwtToken;
import org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    private final String USERNAME="张三";
    private final String PASSWORD="123456";
    @GetMapping("/login")
    public User login(User user){
        if (USERNAME.equals(user.getUsername())&&PASSWORD.equals(user.getPassword())){
            user.setToken(JwtToken.jwt());
            return user;
        }
        return null ;
    }

}
